package com.syni.mdd.sjb.common.component.mybatis.community.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 企业微信用户统计数据实体
 *
 * @author wangbaitao
 * @Date 2021-03-03
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class SjbChatCount implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键Id
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;
    /**
     * 企业id
     */
    private String corpid;
    /**
     * 新增客户群数量
     */
    private Long newChatCnt = 0L;
    /**
     * 截至当天客户群总数量
     */
    private Long chatTotal = 0L;
    /**
     * 截至当天有发过消息的客户群数量
     */
    private Long chatHasMsg = 0L;
    /**
     * 客户群新增群人数。
     */
    private Long newMemberCnt = 0L;
    /**
     * 截至当天客户群总人数
     */
    private Long memberTotal = 0L;
    /**
     * 截至当天有发过消息的群成员数
     */
    private Long memberHasMsg = 0L;
    /**
     * 截至当天客户群消息总数
     */
    private Long msgTotal = 0L;
    /**
     * 数据日期，为当日0点的时间戳
     */
    private LocalDate statTime;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;
    /**
     * 去重后的群聊人数，包含企业成员
     */
    private Long distinctMemberTotal = 0L;
    /**
     * 去重后的群企业成员人数
     */
    private Long distinctCompanyUserTotal = 0L;
    /**
     * 昨日新增去重用户数
     */
    private Long newDistinctMemberCnt = 0L;

    public static final String ID = "id";
    public static final String CORP_ID = "corpid";
    public static final String NEW_CHAT_CNT = "new_chat_cnt";
    public static final String CHAT_TOTAL = "chat_total";
    public static final String CHAT_HAS_MSG = "chat_has_msg";
    public static final String NEW_MEMBER_CNT = "new_member_cnt";
    public static final String MEMBER_TOTAL = "member_total";
    public static final String MEMBER_HAS_MSG = "member_has_msg";
    public static final String MSG_TOTAL = "msg_total";
    public static final String STAT_TIME = "stat_time";
    public static final String CREATE_TIME = "create_time";
    public static final String DISTINCT_MEMBER_TOTAL = "distinct_member_total";
    public static final String DISTINCT_COMPANY_USER_TOTAL = "distinct_company_user_total";
    public static final String NEW_DISTINCT_MEMBER_CNT = "new_distinct_member_cnt";

}